Skip to content

[58_maintenance] Fix sliced sparse union ArrayData conversion - #11759

Merged
alamb merged 2 commits into
apache:58_maintenancefrom
Jefffrey:backport_11649_58
Oct 21, 2026
Merged

alamb merged 2 commits into
apache:58_maintenancefrom
Jefffrey:backport_11649_58

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

skyon0522-ai and others added 2 commits October 21, 2026 22:35
# Which issue does this PR close?

- Closes apache#11582

# Rationale for this change

Converting sliced sparse union `ArrayData` into an array currently reads
values outside the slice. A single-child union can also return a logical
null mask longer than the resulting array.

# What changes are included in this PR?

Apply the parent offset and length to sparse child data before
constructing the child arrays. Dense children retain their existing
offsets and lengths.

# Are these changes tested?

Regression tests compare conversion from sliced `ArrayData` with direct
union slicing, including nonzero offsets, truncation at offset zero,
empty slices, custom type IDs, nullable values, and a dense-union
control.

AI assistance was used to analyze the conversion path and draft the
code, regression tests, and this description.

# Are there any significant user-facing changes?

No public API changes.
@Jefffrey Jefffrey added the bug label Oct 21, 2026
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 21, 2026
@Jefffrey
Jefffrey marked this pull request as ready for review October 21, 2026 12:09
@alamb

alamb commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Merging as MSRV failure is unrelated. I will fix in this PR

@alamb
alamb merged commit 26b5226 into apache:58_maintenance Oct 21, 2026
26 of 27 checks passed
@Jefffrey
Jefffrey deleted the backport_11649_58 branch October 21, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants